home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / DCLAP 6d / dclap6d / DBio.more / UGridStuff.p < prev    next >
Text File  |  1996-07-05  |  3KB  |  101 lines

  1. { UGridStuff.p }
  2. { Copyright 1992 by d.g.gilbert, for SeqApp }
  3.  
  4.  
  5. UNIT UGridStuff;
  6.  
  7. INTERFACE
  8.  
  9. USES
  10. Types, Memory, QuickDraw, ToolUtils, OSUtils, Resources, Packages, 
  11. Files, Printing, TextEdit,
  12.     TextUtils, StandardFile, Scrap, 
  13. Controls, Aliases, Editions, Events, Notification, 
  14. AppleEvents, Processes, Balloons,
  15.  
  16. MacAppTypes, UPascalObject, UObject, 
  17. UEventHandler, UList, UAdorners, UStream, UGeometry,
  18. UEvent, UCommand, UCommandHandler,
  19.     UDependencies,
  20. UView,  UBehavior, UTEView, UTECommands,
  21. UMacAppUtilities, UPatch, UFailure, UMacAppGlobals,
  22.  
  23. UFile, UApplication,
  24. UPrintHandler, UPrinting,
  25. UWindow, UMenuMgr, UMemory, UErrorMgr,
  26.  
  27. UControl, UDialog, UPopup,
  28. UDocument, UFileHandler, UFileBasedDocument,
  29.  
  30. UViewServer, UGridView,
  31.  
  32. {$U $$Shell(UStd)UStandard.p } UStandard, 
  33. {$U $$Shell(UStd)UApp.p } UApp, 
  34. {$U $$Shell(UText)UTextDoc.p } UTextDoc;
  35.  
  36. TYPE
  37.  
  38.     TRCshifter        = OBJECT (TTracker)
  39.         {If possible, get this to work on any TGridView descendant }
  40.         { TRCshifter is a command object to handle mouse movement when
  41.             you select a row (?& col) in given TGridView object }
  42.  
  43.         fGrid        : TGridView;
  44.         fSibling:    TGridView; {associated gridView to drag along}
  45.         
  46.         fRowCol    :    VHSelect;
  47.         fNewRC    :    INTEGER;
  48.         fOldRC    :    INTEGER; { remember previous width for Undo }
  49.         fBounds    : VRect;
  50.         
  51.         PROCEDURE TRCshifter.IRCshifter(itsDocument: TDocument; 
  52.                         itsView: TGridView; itsSibling: TGridView;
  53.                         RowOrCol: VHSelect; atRC: integer);
  54.  
  55.  
  56.          FUNCTION  TRCshifter.TrackMouse(aTrackPhase: TrackPhase; VAR anchorPoint,
  57.                                          previousPoint, nextPoint: VPoint;
  58.                                          mouseDidMove: BOOLEAN): TTracker; OVERRIDE;
  59.                                         
  60.          PROCEDURE TRCshifter.TrackFeedback(aTrackPhase: TrackPhase; 
  61.                             anchorPoint, previousPoint, nextPoint: VPoint; 
  62.                             mouseDidMove, turnItOn: BOOLEAN); OVERRIDE;
  63.                                         
  64.         PROCEDURE TRCshifter.DrawFeedback( anchorPoint, nextPoint: VPoint);
  65.  
  66.          PROCEDURE TRCshifter.TrackConstrain(aTrackPhase: TrackPhase; 
  67.                         anchorPoint, previousPoint: VPoint; VAR nextPoint: VPoint;
  68.                         mouseDidMove: BOOLEAN); OVERRIDE;                            
  69.                             
  70.         PROCEDURE TRCshifter.DoShift( fromRC, toRC: integer);
  71.             {This one does shift, MUST OVERRIDE with particulars of grid storage}
  72.             
  73.         PROCEDURE TRCshifter.DoIt; OVERRIDE;
  74.         PROCEDURE TRCshifter.UndoIt; OVERRIDE;
  75.         PROCEDURE TRCshifter.RedoIt; OVERRIDE;
  76.         END;     
  77.  
  78.  
  79.     TListSlider        = OBJECT (TRCshifter)
  80.             { this variant will shift a list of objects according to Row or Col shift }
  81.         fList    : TList;  {row (or column) list of items }
  82.         fOldTop, fOldBottom: integer;
  83.         fTrackRight,fTrackBottom: integer;
  84.         fOldSelection, fNewSelection: RgnHandle;
  85.  
  86.         PROCEDURE TListSlider.IListSlider( itsGridView: TGridView; itsList: TList;
  87.                                                                                         RowOrCol: VHSelect; atRC: integer);
  88.         PROCEDURE TListSlider.Free; OVERRIDE;
  89.         PROCEDURE TListSlider.DrawFeedback( anchorPoint, nextPoint: VPoint); OVERRIDE;
  90.         PROCEDURE TListSlider.DoShift( fromRC, toRC: integer); OVERRIDE;
  91.          PROCEDURE TListSlider.TrackConstrain(aTrackPhase: TrackPhase; 
  92.                         anchorPoint, previousPoint: VPoint; VAR nextPoint: VPoint;
  93.                         mouseDidMove: BOOLEAN); OVERRIDE;
  94.         END;
  95.  
  96. IMPLEMENTATION
  97.  
  98.         {$I UGridStuff.inc.p}
  99.  
  100. END.
  101.